home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / comt010d.zip / COMT.DOC < prev    next >
Text File  |  1992-06-18  |  8KB  |  207 lines

  1. COMT is Copyright 1991, 1992 Alexander Pruss.  Some rights reserved.
  2.   All use is permitted limited only by the law of the land and natural law.
  3.   I hereby specify that only the exact version I produced belongs to me.
  4.   Any modification, however trivial, renders my rights to this null and void.
  5.   Thus, if you change this copyright message this program shall no longer
  6.   belong to me.  I permit any such modification, and I permit any removal
  7.   of credit to myself for this programme.  NO WARRANTY OF ANY KIND IS GIVEN.
  8.   Interpretation of natural law is left to the user's conscience.
  9.  
  10.  
  11.  
  12.                     OFFICIAL PUBLIC RELEASE OF
  13.                                                 COMT version 0.10d
  14.  
  15.  
  16. This program is used for turning an .COM format executable into a text
  17. file suitable for trasmission over text-only networks such as BITNET or
  18. UseNet.  Unlike other such programs like UUENCODE, it is totally
  19. bootstrapped and does not require any decoder.
  20.  
  21. The executables processed with COMT if originally in .COM format will
  22. still be executable, even after they are turned into a text file.  Of
  23. course the output will be longer than the input, by about 35% for large
  24. files, more for smaller.  This means that after they are sent, possibly
  25. embedded in a message, they can be simply extracted with a text editor
  26. and run as-is with no decoding needed.  The only thing to be remembered
  27. is that by the time the file ends up again on a PC, it must be a PC-text
  28. file, which generally means it has to be transferred always in text
  29. mode.  It is easy to find out whether a file is a PC-text file by just
  30. putting
  31.  
  32.    TYPE filename
  33.  
  34. and seeing if the lines are neatly aligned at the left hand margin.
  35.  
  36. Here is a sample COMT output file:
  37. --OUTPUT BEGINS NEXT LINE--
  38. ENC.COM.BCF=
  39. %00%@@PZ-rm-rm-]#P_R^N15,)P_R^!5RX,p4{P^15RX-qn-qnP-Q!PY-!p-!`-!0P]=
  40. X-s!P_WR^!5GG!5GG!5GG!5GG!5_RX-`K5pPP^15GG15GG15GG15GG-~!5Z#P^15Q_
  41. RX3FcEE<Zt+=
  42. t"-AA
  43. Good-dayR^!5P^15Gu'Hi,Howdy??BJtKM
  44. MPHFOLLNBAJLACAADPEKPFPPHOLIPMBIJOFACABEBNJOOLFACAPLAABADPFKILAABA
  45. AFDDAMLIIMLIAPLIIPLIIODM
  46. S&$ig(Apab000000001C
  47. ELJAKLMABANMBCILAAMENMBCIEFGMGMGPGMCACHFPGCHMGEGBCNAKAEC
  48. Z
  49. --OUTPUT ENDED WITH THE 'Z'--
  50.  
  51. The text in between the two '--' lines can be snipped off into a file
  52. Hello.com, starting with the 'ENC.COM.' line inclusive and ending with
  53. the 'Z' line, also inclusive and then upon Hello.COM being executed, a
  54. 'Hello, World!' message would be displayed.
  55.  
  56.  
  57. Normally, when a .COM file is to be encoded, the line:
  58.  
  59.     comt filename
  60.  
  61. is given and filename.com is replaced by a COMT encoding of itself.
  62.  
  63.    WARNING:  if the output file is longer than 63kB it will not be
  64.    runnable.  COMT does not at present warn of this.  DOS will give an
  65.    out of memory message if you try to run.  Use the comt -x filename
  66.    command to reconstruct the original file.
  67.  
  68. To encode into a different name use
  69.  
  70.    comt filename outname
  71.  
  72. The extensions .COM are default on input and output in this case.
  73.  
  74. Since the file is often supposed to be transmitted by mail, you can
  75. automatically include instructions on how to cut out the program.
  76. Simply include the -w flag,
  77.  
  78.    comt -w filename [outname]
  79.  
  80. and the file filename[.COM] will be converted into a file filename.ASC
  81. or outname[.ASC] depending on whether you specified an outname.  This
  82. file will include directions on how to extract the input file
  83. filename[.COM] inside.  This file will be mentioned in the wrapper by
  84. name as filename[.COM].  If you want a different name, use
  85.  
  86.    comt -w -nnewname filename [outname]
  87.  
  88. where newname is the name you want the wrapper to use for the file.
  89.  
  90.  
  91. By default one of two encoding methods is chosen depending on the size
  92. of the input file.  For small files a 1->2 method is chosen where each
  93. byte is encoded as two bytes, and the bulk of the output consists of
  94. uppercase letters.  For larger files a 3->4 method is used where three
  95. bytes are encoded as four.  I can see no reason for overriding the
  96. choice, unless you want the output to be larger than usual (but see BUGS
  97. section for mention of marginal cases.)  The 3->4 method is obviously
  98. more efficient for larger files, but it suffers from a longer decoder at
  99. the beginning, for smaller files.  To specify 1->2 encoding throw in a
  100. -1 flag, and for 3->4 encoding a -3 flag as in:
  101.  
  102.    comt -1 inname
  103.  
  104.  
  105. You can extract a COMT-processed file into the original.  This may be
  106. useful if you want to save disc space or the miniscule time needed to
  107. decode the executable.  Of course, the COMT-processed executable can be
  108. run just as well as the original, if you wish.
  109.  
  110. If the file filename contains the COMT-processed file, put
  111.  
  112.    comt -x filename [outname]
  113.  
  114. to extract it into the original.  By default the extension of filename
  115. is .COM and outname is filename.COM.  Remember, to do this you need not
  116. take the file out of any message wherein it might be sitting.  If more
  117. than one COMT-processed file is in filename, the first will be
  118. extracted.  Note in particular that if you use comt -w to create
  119. filename.ASC, then
  120.  
  121.    comt -x filename
  122.  
  123. will recreate filename.COM.  Further, running
  124.  
  125.    comt -x comt.doc hello
  126.  
  127. on this documentation file, will create hello.com, as given in the
  128. example above, and this hello.com will be decoded into its pre-COMT
  129. format.
  130.  
  131.  
  132. SELF EXTRACTING ARCHIVES
  133.  
  134. If you have several files you want to bundle into a self-extracting
  135. COMT-style plain-text archive, you have to glue them together first into
  136. a self-extracting .COM file.  This can be done at present with only one
  137. archiving utility, LHARC.  (All others I know create .EXE files;  LHARC
  138. creates .COM files if the output is under 64kB.)  DO NOT USE LHA, AS IT
  139. DOES NOT PRODUCE .COM FILES.  Mr. Robert Jung informs me that in the
  140. future his ARJ archiver may produce .COM self-extracts, but do not hold
  141. your breath.  Here is some info on the LHARC I use:
  142.  
  143. LHarc  version 1.13 (Test version)  Copyright (c) Haruyasu Yoshizaki, 1988-89.
  144. ================================================================  05/04/89  ===
  145.                <<< High-performance file-compression program >>>
  146.  
  147. You can simplify the process by using the COMTARC.COM or COMTARC.BAT
  148. program.  If you have LHARC 1.xx on the path, type:
  149.  
  150.   COMTARC [-w] outname   file1 [file2 ...]
  151.  
  152. to create a COMT-file (i.e text-readable) outname.COM (wrapped as
  153. outname.ASC if -w is given) containing file1 [file2 ...]  (wildcards ARE
  154. permitted) and self-extracting them upon execution.  No extension on
  155. outname may be given.  COMTARC.COM is simply created from COMTARC.BAT by
  156. the PC-Magazine BAT2EXEC utility, and is slightly faster.
  157.  
  158.  
  159. SUMMARY OF OPTIONS
  160.  
  161. comt [-1 -3 -w -nname|-x|-h] name[.COM] [outputname]
  162. Options:
  163.  -x  Extract from file
  164.  -1  Use 1->2 encoding
  165.  -3  Use 3->4 encoding
  166.  -w  Wrap in a text wrapper
  167.  -nname  Set name to wrap as
  168.  -h  This help information
  169.  
  170. By default the input file is overwritten.  If -w is specified, the
  171. output file name.ASC is by default created, unless the outputname
  172. is specified.  Default extension on outputname is .COM except in -w
  173. mode where .ASC is used.
  174.  
  175.  
  176. USEFUL SUGGESTION
  177.  
  178. Run PKware's PKLITE on .COM files before running COMT to save space (and
  179. allow you to COMT larger files.)  COMT appears to be fully compatible
  180. with PKLITE.  I have no connection with PKWARE, and PKLITE is the only
  181. one of their product which I specifically recommend.
  182.  
  183.  
  184. BUGS AND LIMITATIONS
  185.  
  186. For some marginal files an error in choice of 1-2 or 3-4 encoding may
  187. result in files about 40 bytes longer than otherwise.
  188.  
  189. Executables larger than about 45Kb encode to more than 63Kb and so
  190. cannot be run in the encoded format, though COMT -x can be used to
  191. decrypt them.
  192.  
  193. The -x extract option will fail if the file it is extracting from
  194. contains the magic symbols  S&$ig(Ap  at the beginning of a line before
  195. the COMT-processed data.  This should cause no one problems.
  196.  
  197. There may be more bugs.
  198.  
  199. No virus checking software looks under the COMT encoding.  As a plus,
  200. you can look at COMT-processed executable and if it is plain text (no
  201. funny control/extended